<?php
class Order_shopModel extends Model {

	public function get_primary_key() {
		return $this->primary_key = 'id';
	}

	public function set($id, $data) {
		$id = intval($id);
		$data['site'] = App::get_site_id();
	    if ($id) {
	        $this->update($data, 'id=' . $id);
	        return $id;
	    }
	    $this->insert($data);
	    if ($this->get_insert_id()) return $this->get_insert_id();
	    return false;
	}
	
	public function del($id) {
	    $this->delete('order_id=' . $id );
	}

    public function get_all($id){
        $sql = "select * from ".$this->prefix."order_shop where order_id=$id";
        $res = $this->db->query($sql)->result_array();
        return $res;
    }
	
	
	
	
	
	
	
	
	
	


}